Skip to content

Solution

Exercise 1: GuessInput

You can learn more about the npm run new-component command in the “Getting Started” video.

Exercise 2: Keeping track of guesses

We see some modern JS tricks in this one, including spread syntax 👀, array destructuring 👀, and object destructuring 👀. Check out those respective lessons in the JavaScript Primer bonus module if you're not sure how they work!

Exercise 3: Guess slots

Exercise 4: Game logic

Exercise 5: Winning and losing

You can view all of the final code on the “solution” branch on Github.

Stretch Goals

This solution solves the two stretch goal examples provided:

  1. Adding a visible keyboard.
  2. Adding a “restart” button when the game ends.